$(function(){
	let newsId=$("._newsId").text();
	let commentDialog; 
	$.get(
		"comments/my-comment.html",
		function(html) {
			commentDialog = $(html).filter(".modal").appendTo("body");
			let myComments=commentDialog.find("#my-comments").remove();
			let img=$(".l1").find("img").clone();
			let user=$(".l1").find("div").clone();
			img.appendTo($("#div1"));
			user.appendTo($("#div1"));
			$.post(
					"newsComments/my-comment.do", 
					"commentCommentator="+newsId+"&rowMax=100",
					function(data) {
						$.each(data.list,function(i,item){
							let div=myComments.clone();
							div.find(".my-comment-content").text("发表评论:"+item.commentContent);
							div.find(".my-comment-time").text(item.commentTime);
							$("#r1").after(div);
						})
					}, "json"
			);
		}
	);

	$(".my-comments").on("click",function(){
		commentDialog.modal("show");
		return false;
	});
});
